package uni.call.app;

public class StopWatch 
{
    public long StartTime = 0;
    public long StopTime = 0;
    private boolean Running = false;
    
    public void Start()
    {
        this.StartTime = System.currentTimeMillis();
        this.Running = true;
    }
    
    public void Stop()
    {
        this.StopTime = System.currentTimeMillis();
        this.Running = false;
    }
    
    public long GetElapsedTime()
    {
        long elapsed;
        if (Running) {
            elapsed = ((System.currentTimeMillis() - StartTime) / 1000);
        }
        else
        {
            elapsed = ((StopTime - StartTime) / 1000);
        }
        return elapsed;
    }
}
